<?php 
/**
 * User form page. Used in create and update action in UserController.
 *
 * @package   views
 * @subpackage user
 * @since     1.0
 * @filesource
 */
?>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>
	
	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php 
		if ($model->isNewRecord){	
			echo $form->labelEx($model,'username');
			echo $form->textField($model,'username',array('size'=>60,'maxlength'=>255)); 
			echo $form->error($model,'username');
		}
		?>
	</div>

	<div class="row">
		<?php 
		if ($model->isNewRecord){	
			echo $form->labelEx($model,'password');
			echo $form->textField($model,'password',array('size'=>60,'maxlength'=>255)); 
			echo $form->error($model,'password');
		}
		?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'qualifications'); ?>
		<?php echo $form->textArea($model,'qualifications',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'qualifications'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'evestgRef'); ?>
		<?php echo $form->textField($model,'evestgRef',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'evestgRef'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->dropDownList($model,'title',DataUtil::getTitles(),array('empty'=>'Please select'));?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'firstName'); ?>
		<?php echo $form->textField($model,'firstName',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'firstName'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'lastName'); ?>
		<?php echo $form->textField($model,'lastName',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'lastName'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'address1'); ?>
		<?php echo $form->textField($model,'address1',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'address1'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'address2'); ?>
		<?php echo $form->textField($model,'address2',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'address2'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'suburb'); ?>
		<?php echo $form->textField($model,'suburb',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'suburb'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'state'); ?>
		<?php echo $form->textField($model,'state',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'state'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'postcode'); ?>
		<?php echo $form->textField($model,'postcode',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'postcode'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'country'); ?>
		<?php echo $form->textField($model,'country',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'country'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'phone'); ?>
		<?php echo $form->textField($model,'phone',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'phone'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'mobile'); ?>
		<?php echo $form->textField($model,'mobile',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'mobile'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'globalCreate'); ?>
		<?php 
		if($model->isNewRecord)
			echo $form->checkBox($model,'globalCreate',
				array('checked'=>GlobalConfiguration::model()->getByKey('NEW_USER_ACCESS_CREATE')));
		else
			echo $form->checkBox($model,'globalCreate');
		?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'globalView'); ?>
		<?php echo $form->checkBox($model,'globalView'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'globalDownload'); ?>
		<?php echo $form->checkBox($model,'globalDownload'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'globalUpdate'); ?>
		<?php echo $form->checkBox($model,'globalUpdate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'globalDelete'); ?>
		<?php echo $form->checkBox($model,'globalDelete'); ?>
	</div>

	<div class="row">
		<?php 
		if (!$model->isNewRecord){
			echo $form->labelEx($model,'createTime'); 
			echo $model->createTime;
		}
		?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->